/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package View.Model;
import java.util.*;
import javax.swing.tree.DefaultMutableTreeNode;
/**
 *
 * @author ANA
 */
public class Project {
    
    private String projectNome, projectFolder; // Informações Projeto
    private Server servidor;
    private Protocol protocolo;
    private ArrayList<Thing> coisaList = new ArrayList<Thing>();
    
    public Project() { 
        this.protocolo = new Protocol();
        this.servidor = new Server();
    }

    public String getProjectNome() {
        return projectNome;
    }

    public void setProjectNome(String projectNome) {
        this.projectNome = projectNome;
    }

    public String getProjectFolder() {
        return projectFolder;
    }

    public void setProjectFolder(String projectFolder) {
        this.projectFolder = projectFolder;
    }

    public void setProtocol(Protocol protocolo){
        this.protocolo = protocolo;
    }

    public Protocol getProtocol(){
        return protocolo;
    }

    public void setServer(Server servidor){
        this.servidor = servidor;
    }

    public Server getServer(){
        return servidor;
    }

    public ArrayList<Thing> getThing(){
        return this.coisaList;
    }

    public void addThing(Thing coisa){
        this.coisaList.add(coisa);
    }

    public boolean isThing(DefaultMutableTreeNode aoTreeNode){
        if(aoTreeNode.getUserObject().toString().contains(TipoObjeto.THING.getDescription()))
            return true;
        return false;
    }

    public boolean isComponent(DefaultMutableTreeNode aoTreeNode){
        if(aoTreeNode.getUserObject().toString().contains(TipoObjeto.COMPONENT.getDescription()))
            return true;
        return false;
    }

    public boolean isController(DefaultMutableTreeNode aoTreeNode){
        if(aoTreeNode.getUserObject().toString().contains(TipoObjeto.CONTROLLER.getDescription()))
            return true;
        return false;
    }

    public boolean isProtocol(DefaultMutableTreeNode aoTreeNode){
        if(aoTreeNode.getUserObject().toString().contains(TipoObjeto.PROTOCOL.getDescription()))
            return true;
        return false;
    }

    public boolean isServer(DefaultMutableTreeNode aoTreeNode){
        if(aoTreeNode.getUserObject().toString().contains(TipoObjeto.SERVER.getDescription()))
            return true;
        return false;
    }

    
    public boolean isProject(DefaultMutableTreeNode aoTreeNode){
        if(aoTreeNode.getUserObject().toString().contains(TipoObjeto.PROJECT.getDescription()))
            return true;
        return false;
    } 
}
